import * as actionTypes from './constants';
import { fromJS } from 'immutable';

const defaultStatus = fromJS({
  articleList: [
    {
      src: 'https://lupic.cdn.bcebos.com/20191203/3018336040_14.jpg',
      title: '考一次雅思需要多少钱',
      desc: '报考雅思需要多少费用',
    },
  ],
  recommendList: [],
});

const reducer = (state = defaultStatus, action) => {
  switch (action.type) {
    case actionTypes.INIT_HOME:
      return state.set('articleList', action.articleList).set('recommendList', action.recommendList);
    default:
      return state;
  }
};
export default reducer;
